<?php
 jimport('joomla.application.component.view');
 // Load the view framework
 if(!class_exists('VmView'))require(JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers'.DS.'vmview.php');
 jimport('joomla.html.pane');
class svViewTrangcanhan extends JView
{
	function display()
	{
		$task = JRequest::getCMD('task');
		$this->_default();
		parent::display();
	}
	// hien thi chi tiet
	function _default()
	{
		// ket noi voi model
		$model=$this->getModel('trangcanhan');
		// kiem tra xem co phai la add hay edit form khong
		$action=JRequest::getVar('action');
		if($action=='') // vao default
		{
			//toolbar
			$this->toolbarDefault('Xem thong tin ca nhan ');
			// cac bien gia tri
			$idcanbo=JFactory::getUser()->get('id');
			$result=$model->getCanboByIDs($idcanbo);
			$title='Quáº£n lÃ½ cÃ¡c cÃ¡n bá»™';
			// set layout
			$this->assignRef('canbo', $result);
			$this->assignRef('title', $title);
			$this->setLayout('default');
		}
		else
		{
				// account id
				$acid=JFactory::getUser()->get('id');
				$username=$model->getCanboByACID($acid);
				// set layout
				$this->assignRef('username', $username);
				//toolbar
				$this->toolbarEdit('Chinh sua tai khoan ');
				$this->setLayout('edit');
		}

	}
	// them cac button tren thanh toolbar
	function toolbarDefault($title)
	{

	}
	function toolbarAdd($title)
	{

	}
	function toolbarEdit($title)
	{

	}
}
?>